import { DataSetProps } from 'choerodon-ui/pro/lib/data-set/DataSet';
import { FieldType } from 'choerodon-ui/pro/lib/data-set/enum';
import { AxiosRequestConfig } from 'axios';

export default (): DataSetProps => ({
  autoQuery: true,
  fields: [
    { name: 'name', type: FieldType.string, label: '姓名' },
    { name: 'email', type: FieldType.string, label: '邮箱' },
    { name: 'website', type: FieldType.string, label: '主页' },
  ],
  transport: {
    read: (config: AxiosRequestConfig) => ({
      ...config,
      url: '/_api/userDashboard',
      method: 'get',
    }),
  },
  pageSize: 3,
});